import {request} from '@/utils/request'
//base url
const BASE_URL = process.env.VUE_APP_API_BASE_URL
const api = {
    list_device_repair_all :'/device_repair/list_device_repair_all',
    list_device_repair_order_all:'/device_repair/list_device_repair_order_all',
    delete_device_repair_order:'/device_repair/delete_device_repair_order',
    save_device_repair_order:'/device_repair/save_device_repair_order',
    list_device_repair_order_by_user_id:'/device_repair/list_device_repair_order_by_user_id',
    list_spare_parts:'/spare_parts/list_spare_parts',
    save_device_repair:'/device_repair/save_device_repair',
    save_device_repair_spare_parts_receive_relation:'/device_repair/save_device_repair_spare_parts_receive_relation',
    list_spare_parts_receive:'/spare_parts/list_spare_parts_receive',
    save_spare_parts_receive:'/spare_parts/save_spare_parts_receive',
    list_spare_parts_inventory:'/spare_parts/list_spare_parts_inventory',
    save_spare_parts_inventory:'/spare_parts/save_spare_parts_inventory',
    delete_device_repair:'/device_repair/delete_device_repair',
    list_device_repair_spare_parts_receive_relation:'/device_repair/list_device_repair_spare_parts_receive_relation',
    delete_device_repair_spare_parts_receive_relation:'/device_repair/delete_device_repair_spare_parts_receive_relation',
    delete_spare_parts_receive:'/spare_parts/delete_spare_parts_receive'


}

for (const apiKey in api) {
    api[apiKey] = BASE_URL + api[apiKey];
}
export function save_spare_parts_inventory(parameter) {
    return request( api.save_spare_parts_inventory,
        'post',
        parameter,
        // { headers: parameter.hearders }
    )
}

export function delete_spare_parts_receive(parameter) {
    return request( api.delete_spare_parts_receive,
        'post',
        parameter,
        // { headers: parameter.hearders }
    )
}

export function delete_device_repair_spare_parts_receive_relation(parameter) {
    return request( api.delete_device_repair_spare_parts_receive_relation,
        'post',
        parameter,
        // { headers: parameter.hearders }
    )
}

export function list_device_repair_spare_parts_receive_relation(parameter) {
    return request( api.list_device_repair_spare_parts_receive_relation,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function delete_device_repair(parameter) {
    return request( api.delete_device_repair,
        'post',
        parameter,
        // { headers: parameter.hearders }
    )
}


export function list_spare_parts_inventory(parameter) {
    return request( api.list_spare_parts_inventory,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function save_spare_parts_receive(parameter) {
    return request( api.save_spare_parts_receive,
        'post',
        parameter,
        // { headers: parameter.hearders }
    )
}

export function list_spare_parts_receive(parameter) {
    return request( api.list_spare_parts_receive,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function save_device_repair_spare_parts_receive_relation(parameter) {
    return request( api.save_device_repair_spare_parts_receive_relation,
        'post',
        parameter,
        // { headers: parameter.hearders }
    )
}


export function save_device_repair(parameter) {
    return request( api.save_device_repair,
        'post',
        parameter,
        // { headers: parameter.hearders }
    )
}


export function list_spare_parts(parameter) {
    return request( api.list_spare_parts,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function list_device_repair_order_by_user_id(parameter) {
    return request( api.list_device_repair_order_by_user_id,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function save_device_repair_order(parameter) {
    return request( api.save_device_repair_order,
        'post',
        parameter,
        // { headers: parameter.hearders }
    )
}

export function delete_device_repair_order(parameter) {
    return request( api.delete_device_repair_order,
        'post',
        parameter,
        // { headers: parameter.hearders }
    )
}
export function list_device_repair_order_all(parameter) {
    return request( api.list_device_repair_order_all,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function list_device_repair_all(parameter) {
    return request( api.list_device_repair_all,
        'get',
        parameter,
        // { headers: parameter.headers }
    )
}

